package org.budo.cmbc.direct.sdk.entity.ryb;

import org.budo.cmbc.direct.sdk.entity.AbstractCmbcDirectResponse;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * 风评结果查询
 */
@Getter
@Setter
@Accessors(chain = true)
@NoArgsConstructor
public class MERiskResultQryResponse extends AbstractCmbcDirectResponse {
    private static final long serialVersionUID = -4753517405839886116L;

    /**
     * 风评结果,0-通过；1-不通过；2-风评超过有效期（也无法购买该款产品）
     */
    private String riskCheckResult;

    /**
     * 风评分值
     */
    private String riskValue;

    /**
     * 风评不通过原因
     */
    private String reason;

    public MERiskResultQryResponse(String channelJnlNo, String responseJson) {
        super(channelJnlNo, responseJson);

        JSONObject jsonObj = JSON.parseObject(responseJson);

        this.riskCheckResult = jsonObj.getString("RiskCheckResult");
        this.riskValue = jsonObj.getString("RiskValue");
        this.reason = jsonObj.getString("reason");
        ;
    }
}
